/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package attendancecheckerclient;

import java.util.Scanner;

/**
 *
 * @author hEllO
 */
public class clientUI extends javax.swing.JFrame {

    /**
     * Creates new form clientUI
     */
    public clientUI() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        studentPanel = new javax.swing.JPanel();
        informationPanel = new javax.swing.JPanel();
        hello = new javax.swing.JLabel();
        name = new javax.swing.JLabel();
        course = new javax.swing.JLabel();
        year = new javax.swing.JLabel();
        subject = new javax.swing.JLabel();
        summary = new javax.swing.JLabel();
        noOfTardiness = new javax.swing.JLabel();
        noOfAbscences = new javax.swing.JLabel();
        remarks = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        remarksArea = new javax.swing.JTextArea();
        dateAndTime = new javax.swing.JTextField();
        nameField = new javax.swing.JTextField();
        courseField = new javax.swing.JTextField();
        yearField = new javax.swing.JTextField();
        subjectField = new javax.swing.JTextField();
        tardinessField = new javax.swing.JTextField();
        abscencesField = new javax.swing.JTextField();
        buttonsPanel = new javax.swing.JPanel();
        changePwdButton = new javax.swing.JButton();
        logoutButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Attendance Checker");
        setAlwaysOnTop(true);
        setBounds(new java.awt.Rectangle(30, 30, 0, 0));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setIconImages(null);
        setName("clientUI"); // NOI18N
        setUndecorated(true);
        setResizable(false);

        studentPanel.setBackground(new java.awt.Color(0, 51, 51));
        studentPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        studentPanel.setForeground(new java.awt.Color(255, 255, 255));

        informationPanel.setBackground(new java.awt.Color(0, 102, 102));

        hello.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        hello.setForeground(new java.awt.Color(255, 255, 0));
        hello.setText("hELLO");

        name.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        name.setForeground(new java.awt.Color(255, 255, 255));
        name.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        name.setText("Name:");

        course.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        course.setForeground(new java.awt.Color(255, 255, 255));
        course.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        course.setText("Course:");

        year.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        year.setForeground(new java.awt.Color(255, 255, 255));
        year.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        year.setText("Year:");

        subject.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        subject.setForeground(new java.awt.Color(255, 255, 255));
        subject.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        subject.setText("Subject:");

        summary.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        summary.setForeground(new java.awt.Color(255, 255, 255));
        summary.setText("Summary of Attendance");

        noOfTardiness.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        noOfTardiness.setForeground(new java.awt.Color(255, 255, 255));
        noOfTardiness.setText("No. of  Tardiness:");

        noOfAbscences.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        noOfAbscences.setForeground(new java.awt.Color(255, 255, 255));
        noOfAbscences.setText("No. of Abscences:");

        remarks.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        remarks.setForeground(new java.awt.Color(255, 255, 255));
        remarks.setText("Remarks:");

        remarksArea.setEditable(false);
        remarksArea.setBackground(new java.awt.Color(0, 102, 102));
        remarksArea.setColumns(20);
        remarksArea.setForeground(new java.awt.Color(255, 255, 255));
        remarksArea.setRows(5);
        remarksArea.setBorder(null);
        jScrollPane1.setViewportView(remarksArea);

        dateAndTime.setEditable(false);
        dateAndTime.setBackground(new java.awt.Color(0, 102, 102));
        dateAndTime.setFont(new java.awt.Font("Calibri", 0, 24)); // NOI18N
        dateAndTime.setBorder(null);

        nameField.setEditable(false);
        nameField.setBackground(new java.awt.Color(0, 102, 102));
        nameField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        nameField.setForeground(new java.awt.Color(255, 255, 255));
        nameField.setToolTipText("");
        nameField.setBorder(null);

        courseField.setEditable(false);
        courseField.setBackground(new java.awt.Color(0, 102, 102));
        courseField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        courseField.setForeground(new java.awt.Color(255, 255, 255));
        courseField.setBorder(null);

        yearField.setEditable(false);
        yearField.setBackground(new java.awt.Color(0, 102, 102));
        yearField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        yearField.setForeground(new java.awt.Color(255, 255, 255));
        yearField.setBorder(null);

        subjectField.setEditable(false);
        subjectField.setBackground(new java.awt.Color(0, 102, 102));
        subjectField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        subjectField.setForeground(new java.awt.Color(255, 255, 255));
        subjectField.setBorder(null);

        tardinessField.setEditable(false);
        tardinessField.setBackground(new java.awt.Color(0, 102, 102));
        tardinessField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        tardinessField.setForeground(new java.awt.Color(255, 255, 255));
        tardinessField.setBorder(null);

        abscencesField.setBackground(new java.awt.Color(0, 102, 102));
        abscencesField.setForeground(new java.awt.Color(255, 255, 255));
        abscencesField.setBorder(null);

        javax.swing.GroupLayout informationPanelLayout = new javax.swing.GroupLayout(informationPanel);
        informationPanel.setLayout(informationPanelLayout);
        informationPanelLayout.setHorizontalGroup(
            informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(informationPanelLayout.createSequentialGroup()
                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(informationPanelLayout.createSequentialGroup()
                        .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(informationPanelLayout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(remarks))
                            .addGroup(informationPanelLayout.createSequentialGroup()
                                .addGap(103, 103, 103)
                                .addComponent(hello)))
                        .addGap(0, 108, Short.MAX_VALUE))
                    .addGroup(informationPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(informationPanelLayout.createSequentialGroup()
                                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(subject, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(name, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(course, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(year, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(nameField)
                                    .addComponent(courseField)
                                    .addComponent(yearField)
                                    .addComponent(subjectField)))
                            .addGroup(informationPanelLayout.createSequentialGroup()
                                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(noOfTardiness, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(noOfAbscences, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(tardinessField, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                                    .addComponent(abscencesField))))))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, informationPanelLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(summary)
                .addGap(61, 61, 61))
            .addGroup(informationPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(dateAndTime)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, informationPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20))
        );
        informationPanelLayout.setVerticalGroup(
            informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(informationPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(dateAndTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12)
                .addComponent(hello)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(name)
                    .addComponent(nameField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(course)
                    .addComponent(courseField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(year)
                    .addComponent(yearField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(subject)
                    .addComponent(subjectField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addComponent(summary)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(noOfTardiness)
                    .addComponent(tardinessField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(informationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(noOfAbscences)
                    .addComponent(abscencesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(remarks)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout studentPanelLayout = new javax.swing.GroupLayout(studentPanel);
        studentPanel.setLayout(studentPanelLayout);
        studentPanelLayout.setHorizontalGroup(
            studentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(studentPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(informationPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        studentPanelLayout.setVerticalGroup(
            studentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(studentPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(informationPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        buttonsPanel.setBackground(new java.awt.Color(0, 51, 51));
        buttonsPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        changePwdButton.setText("Change Password");
        changePwdButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                changePwdButtonActionPerformed(evt);
            }
        });

        logoutButton.setText("Log-out");
        logoutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout buttonsPanelLayout = new javax.swing.GroupLayout(buttonsPanel);
        buttonsPanel.setLayout(buttonsPanelLayout);
        buttonsPanelLayout.setHorizontalGroup(
            buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(buttonsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(changePwdButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(logoutButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        buttonsPanelLayout.setVerticalGroup(
            buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(buttonsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(changePwdButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(logoutButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(buttonsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(studentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(studentPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void changePwdButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changePwdButtonActionPerformed
        changePassword cp = new changePassword();
        cp.setVisible(true);
    }//GEN-LAST:event_changePwdButtonActionPerformed

    private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutButtonActionPerformed
        nameField.setText(null);
        courseField.setText(null);
        yearField.setText(null);
        subjectField.setText(null);
        tardinessField.setText(null);
        abscencesField.setText(null);
        remarksArea.setText(null);

        setVisible(false);
        
        login login2 = new login();
        login2.setVisible(true);
    }//GEN-LAST:event_logoutButtonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(clientUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new clientUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField abscencesField;
    private javax.swing.JPanel buttonsPanel;
    private javax.swing.JButton changePwdButton;
    private javax.swing.JLabel course;
    private javax.swing.JTextField courseField;
    private javax.swing.JTextField dateAndTime;
    private javax.swing.JLabel hello;
    private javax.swing.JPanel informationPanel;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton logoutButton;
    private javax.swing.JLabel name;
    private javax.swing.JTextField nameField;
    private javax.swing.JLabel noOfAbscences;
    private javax.swing.JLabel noOfTardiness;
    private javax.swing.JLabel remarks;
    private javax.swing.JTextArea remarksArea;
    private javax.swing.JPanel studentPanel;
    private javax.swing.JLabel subject;
    private javax.swing.JTextField subjectField;
    private javax.swing.JLabel summary;
    private javax.swing.JTextField tardinessField;
    private javax.swing.JLabel year;
    private javax.swing.JTextField yearField;
    // End of variables declaration//GEN-END:variables

    private String nameStr;
    private String courseStr;
    private int yearInt;
    private String subjectStr;
    private int noOfTardinessInt;
    private int noOfAbscencesInt;
    private String remarksStr;

}
